import React, { Component } from 'react'
import { Button } from 'antd'
export default class Weather extends Component{
  state = {
    isHot: false
  }
  displayWeather = () => {
    return this.state.isHot ? '今天天气很热' : '今天天气不热'
  }
  change = () => {
    const { isHot } = this.state
    this.setState({ isHot: !isHot })
  }
  render() {
    return (
      <div>
        <div>{this.displayWeather()}</div>
        <Button type="primary" onClick={this.change}>click</Button>
      </div>
    )
  }
}